Documentation > CMS Template API Library > Input > StartDropDownContainer(String,String,Dictionary[String,String],String,String,Boolean)

StartDropDownContainer

Creates a dropdown that will show the controls associated with the currently selected value, while hiding those that are not. All controls that fall under the StartDropDownContainer will correspond to the first item in the rows dictionary. Supports nesting, so calling StartDropDownContainer within another DropDownConntainer will work as expected.

public System.Void StartDropDownContainer(String,String,Dictionary[String,String],String,String,Boolean)

Parameters

NameDescriptionType
label The label. System.String
fieldName The field name where the selected dropdown value will be stored. System.String
rows A dictionary representing the rows that will appear in the drop down. The key is the display label and the value is the html value attribute. Dictionary<String,String>
defaultValue Optional: The desired default value. Setting this field will set the dropdown to this value if nothing has been previously selected. System.String
firstRowLabel Optional: Creates a row in the dropdown menu with the given value, but does not associate it with a set of controls to show and hide. Selecting this value will hide all controls on the resulting form. System.String
alwaysSend Optional: If true, the value of the field will always be sent from the frontend to the backend regardless of whether its state has changed. System.Boolean

Code Example

C#

Sample:

            		
            Dictionary<string, string> dropDownRows = new Dictionary<string, string>() {{"internal label", "internal_link" }, { "external Label", "external_link" }};
            Input.StartDropDownContainer("Link Type", "link_type", dropDownRows, firstRowLabel: "none");
            ShowAcquireParams aParams = new ShowAcquireParams();
            aParams.ShowBrowse = true;
            Input.ShowAcquireDocument("Internal Link", "internal_link", aParams);
            Input.NextDropDownContainer();
            Input.ShowTextBox("External Link", "external_link", "", 50);
            Input.EndDropDownContainer();
            
            	

Connect with Crownpeak